/***************************************************
 @Name :        小铭同学
 @Time :        2025-09-03
 @Email :       LiaoMingWJ233@163.com
 @Comment :     温湿度传感器 设备状态获取
 @FileName :    temhumdevice.cpp
 @Version :     1.0
****************************************************/


#include "temhumdevice.h"

TemHumDevice::TemHumDevice(QObject *parent) : QObject(parent)
{
    tem_hum_init();
}

double TemHumDevice::temCollect()
{
    double ret = 0;
    ret = tem_collect();
    if(ret < 0)
    {
        perror("tem collect faile");
    }
    return ret;
}

float TemHumDevice::humCollect()
{
    float ret = 0;
    ret = hum_collect();
    if(ret < 0)
    {
        perror("hum collect faile");
    }
    return ret;
}

TemHumDevice::~TemHumDevice()
{
    tem_hum_close();
}
